function [ output ]=virtul_vel_err(input)

x_e=input(1);
y_e=input(2);
psi_e=input(3);
K=input(4);
u=input(5);
v=input(6);


%parameter
k1=0.165;k2=0.1;



if sqrt(x_e^2+y_e^2)==0
   gemma_d=K*sin(psi_e)-k1*x_e;
   u_d=K*cos(psi_e)-k2*y_e;
else
    u_d=K*cos(psi_e)-k1*x_e/sqrt(x_e^2+y_e^2);
    gemma_d=K*sin(psi_e)-k2*y_e/sqrt(x_e^2+y_e^2);
end

%r_d=psi_d_dot+(-k_dot*sin(psi_e)-p_sigma2/m22 -lambda-k4*gemma_e-y_e/m22)/K*cos(psi_e);

u_e=u-u_d;
gemma_e=v-gemma_d;
output=[u_e gemma_e u_d gemma_d ];